package com.dst.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dst.entity.User;
import com.dst.mapper.UserMapper;
import com.dst.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
  @Resource
  private UserMapper userMapper;
  @Override
  public User selectByNameAndPassword(User user) {
    QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
    QueryWrapper<User> eq = userQueryWrapper.eq("username", user.getName()).eq("userpassword", user.getPwd());
    User user1 = userMapper.selectOne(eq);
    return user1;
  }
}
